<template>
	<view>{{code}}</view>
</template>

<script>
	export default {
		data() {
			return {
				code:null,
				state:null,
			}
		},
		onLoad(option){ //option为object类型，会序列化上个页面传递的参数
		    console.log(option.code); //打印出上个页面传递的参数。
		    console.log(option.state); //打印出上个页面传递的参数。
			this.code=option.code;
			this.state=option.state;
		},
		onShow() {
			uni.request({
			    url: 'http://localhost:8081/wx/weixinLogin', 
			    data: {
					code:this.code
			    },
			    success: (res) => {
			        console.log(res);
			    }
			});
		}
	}
</script>


<style>
</style>
